﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="edit-coupon.aspx.cs" Inherits="EnmineKaitlin.admin.edit_coupon"   MasterPageFile="~/MasterPage/AdminDefault.Master" %>
<%@ Register Assembly="EnmineKaitlin" Namespace="EnmineKaitlin.Common" TagPrefix="Pagging" %>
<asp:Content ID="ctneditCoupon" runat="server" ContentPlaceHolderID="cphContent">
    <div class="form list">
        <h2><span class="icon"><img src="../images/admin/Play.png"></span>Chuyên mục</h2>
        <div class="content">
            <div class="left add-Coupon">               
                <p class="label">Tên coupon:</p>
                <p class="input"><asp:TextBox ID="txtName" Width="95%" runat="server" CssClass="txt required"></asp:TextBox></p>                
                <p class="label">Nội dung:</p>
                <p class="input"><asp:TextBox ID="txtContent" CssClass="textarea" runat="server" TextMode="MultiLine" Width="93%" Height="100" Rows="5"></asp:TextBox></p>
                <p class="label">Ngày bắt đầu:</p>
                <p class="input"><asp:TextBox ID="txtStartDate" CssClass="txt" runat="server" Width="95%" ></asp:TextBox></p>
                <p class="label">Ngày kết thúc:</p>
                <p class="input"><asp:TextBox ID="txtEndDate" CssClass="txt" runat="server" Width="95%"></asp:TextBox></p>                
                <p class="label">Phần trăm giảm giá:</p>
                <p class="input"><asp:TextBox ID="txtDiscountPercent" CssClass="txt" runat="server" Width="95%" Text="0"></asp:TextBox></p>                
                <p class="label">Trạng thái:</p>
                <p class="input"><asp:DropDownList ID="ddlStatus" runat="server">
                    <asp:ListItem Value="publish" Text="Hiệu lực"></asp:ListItem>
                    <asp:ListItem Value="pending" Text="Tạm ngừng"></asp:ListItem>
                    <asp:ListItem Value="draft" Text="Thùng rác"></asp:ListItem>
                </asp:DropDownList></p>                
                <p class="label">Ảnh đại diện:<input type="button" value="Chọn ảnh đại diện" class="link-btn" onclick="BrowseServer();" /></p>
                <p>&nbsp;<asp:HiddenField ID="hdfFeaturedImage" runat="server" /></p>                
                <p class="input">
                    <asp:Image ID="imgFeaturedImage" runat="server" CssClass="imgFeaturedImage" Width="300" Height="100" />                    
                </p>
                <p class="input"><asp:Button ID="btnAddCat" runat="server" Text="Thêm chuyên mục" CssClass="btn right" CommandName="Add" OnCommand="btnAddCat_Click" /></p>
            </div>
            <div class="list-cat-right">
                <asp:Label ID="lblNotice" runat="server" CssClass="error"></asp:Label>
                <div class="filter">                    
                     <div class="function left">
                        <asp:LinkButton ID="lbtFunctionTop" runat="server" Text="Xóa khuyến mại" CssClass="link-btn fbtnDelete" CommandName="BunkFunction" OnCommand="lbtFunction_Click" CommandArgument="TopFunction"></asp:LinkButton>
                        &nbsp;&nbsp;&nbsp;&nbsp;Trạng thái:&nbsp;
                        <asp:DropDownList ID="ddlStatusFilter" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlStatusFilter_IndexChanged">
                            <asp:ListItem Value="publish" Text="Hiệu lực"></asp:ListItem>
                            <asp:ListItem Value="pending" Text="Tạm ngừng"></asp:ListItem>
                            <asp:ListItem Value="draft" Text="Thùng rác"></asp:ListItem>
                        </asp:DropDownList>
                    </div>                                                  
                </div>
                <asp:GridView ID="grvCoupon" runat="server" AutoGenerateColumns="false" 
                    DataKeyNames="CouponID" Width="100%" 
                    CssClass="tbl-list" AlternatingRowStyle-BackColor="AntiqueWhite" OnRowDataBound="grvCoupon_RowDataBound" 
                    OnRowCommand="grvCoupon_RowCommand" onrowdeleting="grvCoupon_RowDeleting">
                    <Columns>
                        <asp:TemplateField HeaderText="">
                            <ItemTemplate><asp:CheckBox ID="CheckBox1" runat="server" CssClass="cbxItem" /></ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="CouponID">
                            <ItemTemplate><%#Eval("CouponID") %></ItemTemplate>
                        </asp:TemplateField>    
                        <asp:BoundField HeaderText="Tên khuyến mại" DataField="Name" />                    
                        <asp:BoundField HeaderText="Nội dung" DataField="Content" />
                        <asp:BoundField HeaderText="Phần trăm giảm giá" DataField="DiscountPercent" />                                                
                        <asp:TemplateField HeaderText="Thao tác" ItemStyle-Width="60">
                            <ItemTemplate>
                                <a href='/admin/edit-coupon.aspx?couponid=<%#Eval("CouponID") %>' class="btnEdit">Sửa</a>
                                <asp:LinkButton ID="lbtDelete" runat="server" CssClass="btnDelete" Text="Xóa" CommandName="Delete" CommandArgument='<%#Eval("CouponID") %>'></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
                <div class="pagenav">
                    <Pagging:PaggingControl runat="server" ID="ctlPagging" Mode="Url" PageSize="20"
                    PreviousClause="<img src='../images/Back.png'/>" NextClause="<img src='../images/Forward.png'/>" />
                </div>
                <div class="filter">
                    <div class="function left">
                        <asp:LinkButton ID="lbtFunctionBottom" runat="server" Text="Xóa khuyến mại" CssClass="link-btn fbtnDelete" CommandName="BunkFunction" OnCommand="lbtFunction_Click" CommandArgument="BottomFunction"></asp:LinkButton>	            
                    </div>                                
                </div>
            </div>
        </div>
    </div>
</asp:Content>
